import http from "@/utils/http";
const GroupApi = {
//     查询所有组以及组内所有用户信息
    getAllGroup: () => {
        return http.get('/group');
    },
// 新增组
    addGroup: (data: any) => {
        return http.post('/group', data);
    },
    // 删除组
    deleteGroup: (groupId: number) => {
        return http.delete(`/group/${groupId}`);
    },
    // 绑定多个用户到一个组
    addUsersToGroup: (data: any) => {
        return http.post('/group/bind-users', data);
    },
//     查询分组
    getGroup: () => {
        return http.get(`/group/group`);
    },
//     根据组id查询组内所有用户
    getUsersByGroupId: (groupId: number) => {
        return http.get(`/group/users/${groupId}`);
    }
}
export default GroupApi;